package cn.cvs.service;

import cn.cvs.mapper.FruitMapper;
import cn.cvs.pojo.Fruit;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Service
public class FruitServiceImpl implements FruitService{
    @Autowired
    private FruitMapper fruitMapper;
    @Override
    public List<Fruit> getlist(String type,String breed,Integer pageIndex,Integer pageSize) {
        Integer zz=(pageIndex-1)*pageSize;
        return fruitMapper.getlist(type,breed,zz,pageSize);
    }

    @Override
    public Fruit selectById(int id) {
        return fruitMapper.selectById(id);
    }

    @Override
    public int delete(int id) {
        return fruitMapper.delete(id);
    }

    @Override
    public int add(Fruit fruit) {
        return fruitMapper.add(fruit);
    }

    @Override
    public int upd(Fruit fruit) {
        return fruitMapper.upd(fruit);
    }

    @Override
    public int count(String type,String breed) {
        return fruitMapper.count(type, breed);
    }
}
